/**
  ******************************************************************************
  * @file    bs32f1xx_ll_ana.c
  * @author  MCU Application Team
  * @brief   ANA LL module driver.
  ******************************************************************************
  */
#if defined(USE_FULL_LL_DRIVER)

/* Includes ------------------------------------------------------------------*/
#include "bs32f1xx_ll_ana.h"

#ifdef  USE_FULL_ASSERT
#include "bs32_assert.h"
#else
#define assert_param(expr) ((void)0U)
#endif

/** @addtogroup BS32F1xx_LL_Driver
  * @{
  */

/** @addtogroup ANA_LL ANA
  * @{
  */ 

 /* Exported functions --------------------------------------------------------*/
/** @addtogroup ANA_LL_Exported_Functions
  * @{
  */

/**
  * @brief  Initialize the BOR.
  * @param  Threshold This parameter can be one of the following values:
  *         @arg @ref LL_BOR_VTH_THRESHOLD_0
  *         @arg @ref LL_BOR_VTH_THRESHOLD_1
  *         @arg @ref LL_BOR_VTH_THRESHOLD_2
  *         @arg @ref LL_BOR_VTH_THRESHOLD_3
  *         @arg @ref LL_BOR_VTH_THRESHOLD_4
  * @param  DelayTime This parameter can be one of the following values:
  *         @arg @ref LL_BOR_DELAYTIME_0
  *         @arg @ref LL_BOR_DELAYTIME_1
  * @note
  *|        DelayTime      |        Threshold         |   Power down threshold(v)   |   Recovery threshold(v)   |  Hyst(mv)  |  Delay(us)  |
  *|:---------------------:|:------------------------:|:---------------------------:|:-------------------------:|:----------:|:-----------:|
  *|   LL_BOR_DELAYTIME_0  |  LL_BOR_VTH_THRESHOLD_0  |            1.902            |            2.015	        |     113	 |    59.96    |
  *|   ^                   |  LL_BOR_VTH_THRESHOLD_1  |            1.997            |            2.103	        |     106	 |    63.83    |
  *|   ^                   |  LL_BOR_VTH_THRESHOLD_2  |            2.205            |            2.311	        |     106	 |    72.26    |
  *|   ^                   |  LL_BOR_VTH_THRESHOLD_3  |            2.496            |            2.612	        |     116	 |    83.82    |
  *|   ^                   |  LL_BOR_VTH_THRESHOLD_4  |            2.796            |            2.907	        |     111	 |    95.3     |
  *|   LL_BOR_DELAYTIME_1  |  LL_BOR_VTH_THRESHOLD_0  |            1.899            |            2.015	        |     116	 |    120.1    |
  *|   ^                   |  LL_BOR_VTH_THRESHOLD_1  |            1.994            |            2.103	        |     109	 |    128.4    |
  *|   ^                   |  LL_BOR_VTH_THRESHOLD_2  |            2.201            |            2.311	        |     110	 |    146.4    |
  *|   ^                   |  LL_BOR_VTH_THRESHOLD_3  |            2.491            |            2.612	        |     121	 |    171      |
  *|   ^                   |  LL_BOR_VTH_THRESHOLD_4  |            2.791            |            2.907	        |     116	 |    195.3    |
  * @retval None
  */
void LL_BOR_Init(uint32_t Threshold,uint32_t DelayTime)
{
	 MODIFY_REG(RCC->BORCFG, RCC_BORCFG_VTH, Threshold);
	 MODIFY_REG(RCC->BORCFG, RCC_BORCFG_DT, DelayTime);	 
}

/**
  * @}
  */

/**
  * @}
  */

/**
  * @}
  */
#endif /* USE_FULL_LL_DRIVER */

/************************ (C) COPYRIGHT BSMicroelectronics *****END OF FILE****/

